import { getCurrentUser } from '@/domain/authority/api/login';
import { getCookie } from '@/utils/cookies';
import { getBaseUrl, getQueryVariable } from '@/utils/http';
import { computed, defineComponent, onMounted, ref } from 'vue';
import p1 from '@/project/dataBoard/assets/images/icon_function_limit.png';
import p2 from '@/project/dataBoard/assets/images/icon_data_use.png';
import empty_no_access from '@/project/dataBoard/assets/images/empty_no_access.png';
import { useMenuStore } from '@/domain/dataBoard/hooks/menu';
import { copyText } from '@/utils/domTool';
import { message } from 'ant-design-vue';
const Introduce = defineComponent({
  props: {},
  setup() {
    const store = useMenuStore();
    const isNoAuthority = computed(() => store.state.menuData.length == 0);
    const isAuthCss = computed(() => (isNoAuthority.value ? ' items-stretch' : ' items-center'));
    return () => (
      <div class={'w-full h-full overflow-hidden '}>
        <div class={'w-full mt-2 h-full bg-white'}>
          {isNoAuthority.value ? (
            <div class="w-2/5 h-2/5 bg-white mr-auto ml-auto  ">
              <img src={empty_no_access} class=" w-r23 h-auto  m-auto pt-12" />
              <div class="text-xl relative left-1/2 inline-block transform -translate-x-1/2  font-medium" style="color:#333333">
                暂无数据权限 请联系管理员开通
              </div>
            </div>
          ) : null}
          <div class={' w-full h-full flex flex-row text-center justify-around ' + isAuthCss.value} style={{ height: isNoAuthority.value ? '60%' : '100%' }}>
            <div class={'w-r27 h-r16 bg-gray-120 text-center flex-initial p-5 rounded-lg'}>
              <div class={'text-center'}>
                {' '}
                <img class={' inline-block w-9 m-8'} src={p1}></img>
              </div>
              <span class={'text-lg text-gray-350 font-semibold'}>功能和数据权限说明</span>
              <br />
              <a
                href="#"
                onClick={() => {
                  copyText('https://yach-doc-shimo.zhiyinlou.com/docs/KrCJc6hPGcRpVcCx/').then(() => {
                    message.success('已经复制到剪切板，需要复制到知音楼打开');
                  });
                }}
                class={' inline-block m-3  text-red-650'}
              >
                复制链接
                <i class={'iconfont icon-icon_download ml-2'}></i>
              </a>
            </div>
            <div class={'w-r27 h-r16 bg-gray-120 text-center flex-initial  p-5 rounded-lg'}>
              <div class={'text-center'}>
                {' '}
                <img class={' inline-block w-9 m-8'} src={p2}></img>
              </div>
              <span class={'text-lg text-gray-350 font-semibold'}>平台数据权限说明</span>
              <br />
              <a
                href="#"
                onClick={() => {
                  copyText('https://yach-doc-shimo.zhiyinlou.com/sheets/TWC38jThrrYdpcqw/MODOC/').then(() => {
                    message.success('已经复制到剪切板，需要复制到知音楼打开');
                  });
                }}
                class={' inline-block m-3  text-red-650'}
              >
                复制链接
                <i class={'iconfont icon-icon_download ml-2'}></i>
              </a>
            </div>
          </div>
        </div>
      </div>
    );
  }
});

Introduce.displayName = 'introduce';

export default Introduce;
